#include "QAdvanceOp.h"
#include "QBasicOp.h"
#include "QAdvanceOP.h"

using namespace DL;

Tensor3D<int8>& DL::QConv(const Tensor3D<int8>& tensor, QATParams in, int stride, int padding, int maxpoolSize, const Tensor4D<int8>& weight, const Tensor1D<float>& scale, const Tensor1D<float>& bias, QATParams out)
{
	Tensor3D<int8>& convResult = QConv2D(tensor, in, stride, padding, weight, scale, bias, out);
	Tensor3D<int8>& reluResult = QRelu(convResult);
	Tensor3D<int8>& maxpoolResult = QMaxPooling2D(reluResult, maxpoolSize, maxpoolSize, 0);
	delete& convResult;
	delete& reluResult;
	return maxpoolResult;
}

Tensor1D<int8>& DL::QFullConnect(const Tensor1D<int8>& tensor, QATParams in, const Tensor2D<int8>& weight, const Tensor1D<float>& scale, const Tensor1D<float>& bias, QATParams out)
{
	Tensor1D<int8>& linearResult = QLinear(tensor, in, weight, scale, bias, out);
	Tensor1D<int8>& reluResult = QRelu(linearResult);
	delete& linearResult;
	return reluResult;
}
